﻿using System;

namespace XEvolve.Core.Runtime.Attributes
{
    [AttributeUsage(AttributeTargets.Parameter)]
    public class ExtensionPointAttribute : Attribute, IDependencyAttribute
    {
        private readonly object identifier;

        public ExtensionPointAttribute(object identifier)
        {
            this.identifier = identifier;
        }

        public object ProvideValue(IExtensionRegistry registry)
        {
            return registry.GetExtensionPoint(identifier);
        }
    }
}